#   -*- mode: makefile; coding: utf-8; -*-
#
#   Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
#   This file is part of Intromit.
#
#   Intromit is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   Intromit is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with Intromit.  If not, see <http://www.gnu.org/licenses/>.

LIBTOOL = @LIBTOOL@

nobase_lib_LTLIBRARIES = intromit/test/libpython_basic.la intromit/test/libpython_members.la \
	intromit/test/libpython_methods.la intromit/test/libpython_misc.la \
	intromit/test/libpython_obj.la intromit/test/libpython_doc.la

intromit_test_libpython_basic_la_LIBADD   = -lstdc++
intromit_test_libpython_basic_la_SOURCES  = python_basic.cc python_basic.hh
intromit_test_libpython_members_la_LIBADD = -lstdc++
intromit_test_libpython_members_la_SOURCES= python_members.cc python_members.hh
intromit_test_libpython_methods_la_LIBADD = -lstdc++
intromit_test_libpython_methods_la_SOURCES= python_methods.cc python_methods.hh
intromit_test_libpython_misc_la_LIBADD    = -lstdc++
intromit_test_libpython_misc_la_SOURCES   = python_misc.cc python_misc.hh
intromit_test_libpython_obj_la_LIBADD     = -lstdc++
intromit_test_libpython_obj_la_SOURCES    = python_obj.cc python_obj.hh
intromit_test_libpython_doc_la_LIBADD     = -lstdc++
intromit_test_libpython_doc_la_SOURCES    = python_doc.cc python_doc.hh

#noinst_PROGRAMS = test_pyembed
bin_PROGRAMS = test_pyembed

test_pyembed_SOURCES  = test_pyembed.c
test_pyembed_LDADD    = ../src/backends/python_embed/intromit/backends/libpyintromit_embed.la

# simple rule to generate metadata info using gendata generator
intromit_FLAGS = -v0 -c ../etc/intromit/metadata.cfg \
		 -m ../src/generators/gendata/intromit/generators/.libs/
intromit       = ../src/intromit/intromit
all-local: $(patsubst intromit/test/%.la,intromit/test/.libs/%.gendata,$(nobase_lib_LTLIBRARIES))
%.gendata : %.so
	$(intromit) $(intromit_FLAGS) -o $@ $<

INCLUDES = -I../src/backends/python_embed/intromit

EXTRA_DIST = python_config.py.in python_test_suite.py python_basic.py \
	python_members.py python_methods.py python_misc.py python_obj.py \
	python_doc.py python_runner.py test_distribution.sh

MAINTAINERCLEANFILES = Makefile.in

clean-local:
	rm -rf *~ *.da *.la *.pyc intromit
